<?php

use yii\db\Migration;

class m161104_052626_create_message extends Migration
{
    public function up()
    {
        $this->createTable('kd_message',[
            'mid'=>$this->primaryKey()->comment('序号'),
            'title'=>$this->string(15)->notNull()->comment('标题'),
            'receiver'=>$this->char(10)->notNull()->comment('发送对象'),
            'content'=>$this->text()->notNull()->comment('正文'),
            'image'=>$this->string(20)->comment('图片'),
            'bid'=>$this->integer(10)->notNull()->comment('所属班级id'),
            'yid'=>$this->integer(10)->notNull()->comment('所属幼儿园id'),
            'feedback_type'=>$this->string(15)->comment('反馈类型'),
            'addtime'=>$this->dateTime()->comment('发布时间'),
        ]);

    }

    public function down()
    {
        $this->dropTable('kd_message');
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
